package io.github.hayeka.a1_threadlocalandmultidatasource.前置知识.A4;

//==================================
//      @Author hayeka
//      @Email hayeka@2980.com
//      @Date 2021/6/16
//==================================

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class T_Test_ThreadLocal_3 {
    //先拿Logger对象
    private static final Logger logger = LoggerFactory.getLogger(T_Test_ThreadLocal_3.class);

    private static ThreadLocal<String> qianBao = new ThreadLocal<>();

    public static void main(String[] args) {

        new Thread(new Runnable() {
            @Override
            public void run() {
                //👨给的创业资金
                qianBao.set("5个亿");
                logger.info("我的钱包有=>{}",qianBao.get());
            }
        }, "高富帅").start();

        new Thread(new Runnable() {
            @Override
            public void run() {
                //高富帅刷的火箭
                qianBao.set("100W");
                logger.info("我的钱包有=>{}",qianBao.get());
            }
        }, "网红").start();

        new Thread(new Runnable() {
            @Override
            public void run() {
                //终于发工资了，我要买买买
                qianBao.set("8000");
                logger.info("我的钱包有=>{}",qianBao.get());
            }
        }, "我").start();

    }
}
